import matplotlib.pyplot as plt
import numpy as np
from test3 import create_polar_system

# 创建极坐标系
fig, ax = create_polar_system(r_range=(0, 5))

# 圆心在极点的圆方程：ρ = R
theta = np.linspace(0, 2*np.pi, 100)
radius = 2
rho = np.full_like(theta, radius)
ax.plot(theta, rho, 'r-', linewidth=2, label=f'圆心在极点: ρ = {radius}')

# 添加图例
ax.legend(loc='upper right', bbox_to_anchor=(1.15, 1.15))

# 标记极点
ax.plot(0, 0, 'ko', markersize=6, label='极点')
ax.text(0.1, 0.3, 'O', fontsize=10, color='black')

plt.tight_layout()
plt.show()